﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace RazakiSite.UserControls
{
    public partial class UCEditor : BaseUserControl
    {
        public EToolsFile UCToolsFile
        {
            set { RadEditor.ToolsFile = string.Format("~/App_Data/RadEditor/{0}.xml", value); }
        }

        public EditModes UCEditModes
        {
            set
            {
                RadEditor.EditModes = value;

                switch (value)
                {
                    case EditModes.Design:
                        RadEditor.EditModes = RadEditor.EditModes ^ EditModes.Preview;
                        break;
                }
            }
        }

        public string UCContent
        {
            get { return RadEditor.Content; }
            set { RadEditor.Content = value; }
        }

        public Unit UCWidth
        {
            set { RadEditor.Width = value; }
        }

        public Unit UCHeight
        {
            set { RadEditor.Height = value; }
        }

        public bool ShowHelp
        {
            set { pnlHelp.Visible = value; }
        }

        public string Caption
        {
            set
            {
                divCaption.Visible = true;

                lblCaption.Text = string.Format("{0}:", value);
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            //css
            RadEditor.DataBind();
        }

        #region >>>Enum<<<

        public enum EToolsFile
        {
            ToolsFileLow,
            ToolsFileMedium
        }

        #endregion

    }
}